Introduction

This script is used to generate all main and supplementary figure as well as the supplementary file

Section: Data processing

Figure S1: Rarefaction of IWW and SWW

Section: Sample collection

Figure S2: Sample timeline

Section: Overview of microbial communities in the sewer system and WWTP

Print the numbers that are used in the article regarding Classification and diversity

## # A tibble: 6 × 4
##   SampleContent2  mean    sd     n
##   <fct>          <dbl> <dbl> <int>
## 1 Biofilm (g.)   1003.  310.    19
## 2 Sediment        878.  226.    16
## 3 Biofilm (e.p.) 1050.  236.    10
## 4 SWW            1749.  258.    45
## 5 IWW            1941.  144.    56
## 6 AS             1791.  115.    89
##                         SampleContent2     mean median       sd  n    q1
## 1 Biofilm (e.p.),Sediment,Biofilm (g.) 41115.58  17896 47997.27 45 12648
##   SampleContent2  mean median sd  n    q1
## 1            IWW 14728  14728  0 56 14728
##   SampleContent2     mean median       sd  n    q1
## 1            SWW 16247.27  13898 9200.349 45 11058
##   SampleContent2     mean median       sd  n    q1
## 1             AS 14698.35  14728 279.7334 89 14728

Figure S3: Diversity indexes

Figure S4: Rank abundance

Figure S5: Classified ASVs

Figure 2: Overall PCA and distinct OTUs

Observed OTU

PCOA of all

Combine plots

Adonis tests

c(“SampleContent2”, “SampleContent2_SampleSite”, “SampleEnvironment”)c(“
OTU ADONIS analysis for SampleContent2.
R2=0.67, p<0.001.
The varibles tested are: SWW, Sediment, Biofilm (e.p.), Biofilm (g.), AS, IWW.
”, “
OTU ADONIS analysis for SampleContent2_SampleSite.
R2=0.76, p<0.001.
The varibles tested are: sewage_Roden, sewage_Skolesti, sewage_Visse, sewage_Doctorvej, sewage_Tvaesgade, sewage_Sejlflod, sewage_Frejlev, sewage_Stadionvej, sediment_Stadionvej, sediment_Tvaesgade, biofilm_end_pressure_Sejlflod, sediment_Roden, biofilm_Frejlev, biofilm_end_pressure_Doctorvej, sediment_Frejlev, biofilm_Visse, biofilm_Roden, biofilm_Skolesti, biofilm_Tvaesgade, biofilm_Stadionvej, AS_AalborgØst, IWW_AalborgWest_after, AS_AalborgWest, IWW_AalborgØst_after.
”, “
OTU ADONIS analysis for SampleEnvironment.
R2=0.58, p<0.001.
The varibles tested are: wastewater, sewer_wet_solids, AS.
”)

Figure S6: Most abundant genera across all

## [1] "AS"                             "sewer_wet_solids"              
## [3] "sewer_wet_solids;AS"            "sewer_wet_solids;wastewater;AS"
## [5] "wastewater"                     NA

Section: Immigration of process-critical bacteria from wastewater to activated sludge

Figure 3: Growth bar plot

Figure S7: Growth bar plot each SWW site

Figure S8: Most abundant species across all

Section: Core species in the sewer microbiome

Figure 4: PCoA of sewer envionments (Sample types)

SampleContent2
Species ADONIS analysis for SampleContent2.
R2=0.41, p<0.001.
The varibles tested are: Sediment, Biofilm (e.p.), Biofilm (g.).

Figure S9: PCoA of sewer envionments (Sample sites)

c(“SampleContent2”, “SampleSite”)c(“
Species ADONIS analysis for SampleContent2.
R2=0.31, p<0.001.
The varibles tested are: Sediment, Biofilm (g.).
”, “
Species ADONIS analysis for SampleSite.
R2=0.37, p<0.001.
The varibles tested are: Stadionvej, Tvaergade, Roden, Frejlev.
”)

Figure S10: Most abundant species across all sites - sewer microbiome

Figure 5: Stacked bar - Best core

## [1] "type is: Cummulative abundance. Can be set to either 'Cummulative abundance'or 'No. of species and unclassified ASVs (transformed to %)"
## [1] "type is: No. of species and unclassified ASVs (transformed to %). Can be set to either 'Cummulative abundance'or 'No. of species and unclassified ASVs (transformed to %)"

Figure 6: Growth groups per core group

Subplots

Strict core

General core

Loose core

Detected

unknown

Merge growth plots

Section: Each sewer environment hosts a specialized community

Figure 7: Core sewer genera heatmap with metabolic potential

Figure S11: HM of gut species inclunding genus name

Figure S12: Heatmap of functional guilds

Section: Wastewater resembles biofilm and sediments after rain

Subplot: SWW

## # A tibble: 3 × 11
##   SampleContent2_2      .y.   group1 group2    n1    n2 statistic    df        p
##   <fct>                 <chr> <chr>  <chr>  <int> <int>     <dbl> <dbl>    <dbl>
## 1 SWW (g.) : Biofilm (… dist… none … one r…   571    57     10.1   60.5 1.47e-14
## 2 SWW (g.) : Sediment   dist… none … one r…   480    48     11.0   51.4 4.21e-15
## 3 SWW (g.) : Biofilm (… dist… none … one r…   300    30      5.69  31.3 2.91e- 6
## # ℹ 2 more variables: p.adj <dbl>, p.adj.signif <chr>

IWW BC compared to biofilm and sediments

Figure S15: The Bray-Curtis (BC) distance between IWW and sewer environments as a function of time since rain event rain (TSR) for IWW from Aalborg East and West WWTP.

Subplot IWW More or less than TSR >= 3 Days

## # A tibble: 3 × 12
##   SampleSite    SampleContent2_2 .y.   group1 group2    n1    n2 statistic    df
##   <chr>         <fct>            <chr> <chr>  <chr>  <int> <int>     <dbl> <dbl>
## 1 AalborgWest_… IWW : Biofilm (… dist… < 3 d… ≥ 3 d…   342   532     13.9   702.
## 2 AalborgWest_… IWW : Sediment   dist… < 3 d… ≥ 3 d…   288   448     13.6   673.
## 3 AalborgWest_… IWW : Biofilm (… dist… < 3 d… ≥ 3 d…   180   280      7.54  424.
## # ℹ 3 more variables: p <dbl>, p.adj <dbl>, p.adj.signif <chr>

Combined plot for article

Figure S13: Cumulative abundance of sewer and gut core for rainy non rainy samples

During rainfall SWW resemples the sediment and biofilm envionments

Figure S14: TSR

Section: discussion

Make metadata sheet for supplementary materials

This code selects and renames column relevant to include in the supplementary file 1

Sheet 1: Overview of samplesites and sample dates Sheet 2: Map of Sample locations (pasted as a picture) Sheet 3: Sequences and names of gut species Sheet 4: Best core species (+ core group of each sample type) Sheet 5: Abundant core genera Sheet 6: Growth groups at the species level + unclassified ASVs Sheet 7: Data from DMI and calculation of TSR

Make files to SRA archive

Sample metadata

SRA metadata

Stop

SWW by Sample Site

SWW by Earth temp (SWW)

Sewer Core bacteria

Aalborg West

Aalborg West

Aalborg East

Figure SXX: Growth bar plot (rarefied data)

Figure SXX: Most abundant species across sewer envionments per sample site

##  [1] "s__midas_s_4"                  "s__midas_s_2077"              
##  [3] "s__Simplicispira_psychrophila" "s__midas_s_2606"              
##  [5] "s__Comamonas_denitrificans"    "s__midas_s_2907"              
##  [7] "s__midas_s_785"                "s__midas_s_1025"              
##  [9] "s__midas_s_4525"               "s__midas_s_10145"             
## [11] "s__Thauera_terpenica"          "s__midas_s_140"               
## [13] "s__Simplicispira_piscis"       "s__midas_s_256"               
## [15] "s__Enterococcus_aquimarinus"   "s__midas_s_1262"              
## [17] "s__Acetobacterium_wieringae"   "s__Acidovorax_temperans"      
## [19] "s__midas_s_1744"               "s__midas_s_2705"              
## [21] "s__Thiothrix_lacustris"        "s__midas_s_1292"              
## [23] "s__midas_s_333"                "s__Paracoccus_lutimaris"      
## [25] "s__midas_s_5409"               "s__midas_s_338"               
## [27] "s__midas_s_193"                "s__midas_s_64864"             
## [29] "s__midas_s_1462"               "s__midas_s_4730"              
## [31] "s__midas_s_4035"               "s__midas_s_572"               
## [33] "s__midas_s_3664"               "s__midas_s_23331"             
## [35] "s__midas_s_845"                "s__midas_s_3317"              
## [37] "s__midas_s_1351"               "s__Thiothrix_unzii"           
## [39] "s__midas_s_525"                "s__midas_s_37971"             
## [41] "s__Azonexus_phosphorivorans"   "s__midas_s_7439"              
## [43] "s__Novosphingobium_tardaugens" "s__midas_s_10373"             
## [45] "s__Thermomonas_carbonis"       "s__midas_s_1949"              
## [47] "s__midas_s_128"                "s__midas_s_3965"              
## [49] "s__midas_s_2429"
## [1] "sewer_wet_solids"

Figure SXX: Most abundant genera across sewer envionments per sample site

##  [1] "g__Trichococcus"                                      
##  [2] "g__Acidovorax"                                        
##  [3] "g__Simplicispira"                                     
##  [4] "g__Rhodoferax"                                        
##  [5] "g__Proteiniclasticum"                                 
##  [6] "g__Comamonas"                                         
##  [7] "g__Christensenellaceae_R-7_group"                     
##  [8] "g__Polaromonas"                                       
##  [9] "g__Thauera"                                           
## [10] "g__Acetobacterium"                                    
## [11] "g__Flavobacterium"                                    
## [12] "g__Leptotrichia"                                      
## [13] "g__Ca_Competibacter"                                  
## [14] "g__Limnohabitans"                                     
## [15] "g__Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium"
## [16] "g__Paracoccus"                                        
## [17] "g__Arcobacter"                                        
## [18] "g__Paludibacter"                                      
## [19] "g__Pseudorhodobacter"                                 
## [20] "g__Enterococcus"                                      
## [21] "g__Desulfobulbus"                                     
## [22] "g__Chryseobacterium"                                  
## [23] "g__Thiothrix"                                         
## [24] "g__midas_g_343"                                       
## [25] "g__Hydrogenophaga"                                    
## [26] "g__Brooklawnia"                                       
## [27] "g__Aestuariimicrobium"                                
## [28] "g__midas_g_467"                                       
## [29] "g__Tessaracoccus"                                     
## [30] "g__midas_g_249"                                       
## [31] "g__Propioniciclava"                                   
## [32] "g__midas_g_164"                                       
## [33] "g__Clostridium_sensu_stricto_1"                       
## [34] "g__Actinomyces"                                       
## [35] "g__Romboutsia"                                        
## [36] "g__midas_g_49"                                        
## [37] "g__Lactivibrio"                                       
## [38] "g__Novosphingobium"                                   
## [39] "g__Azonexus"                                          
## [40] "g__Leucobacter"                                       
## [41] "g__Thermomonas"                                       
## [42] "g__Cereibacter"                                       
## [43] "g__Microbacterium"
## [1] "sewer_wet_solids"

Stacked bar rarefied: Best core